package com.dy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dy.domain.Gzlb;

import com.dy.mapper.GzlbMapper;
import com.dy.service.GuanzlbService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 须尽欢
* @description 针对表【gzlb】的数据库操作Service实现
* @createDate 2024-12-12 09:42:21
*/
@Service
public class GzlbServiceImpl extends ServiceImpl<GzlbMapper, Gzlb>
    implements GuanzlbService {


    @Override
    public Integer add(Gzlb gzlb) {
        LambdaQueryWrapper<Gzlb> lam=new LambdaQueryWrapper<>();
        lam.eq(Gzlb::getUid,gzlb.getUid());
        lam.eq(Gzlb::getLid,gzlb.getLid());
        Gzlb gzlb1 = baseMapper.selectOne(lam);
        if (gzlb1!=null){
            return 1;
        }else {
            baseMapper.insert(gzlb);
            return 2;
        }

    }

    @Override
    public List<Gzlb> findzbgz(Integer lid) {
        LambdaQueryWrapper<Gzlb> lam=new LambdaQueryWrapper<>();
        lam.eq(Gzlb::getLid,lid);
        return baseMapper.selectList(lam);
    }


}




